1 module directx.d3d11_1; 2 /*------------------------------------------------------------------------------------- 3 * 4 * Copyright (c) Microsoft Corporation 5 * 6 *-------------------------------------------------------------------------------------*/ 7 8 version(Windows): 9 version(Direct3D_11): 10 11 public import directx.dxgi1_2; 12 public import directx.d3d11; 13 14 alias D3D11_COPY_FLAGS = int; 15 enum : D3D11_COPY_FLAGS 16 { 17 D3D11_COPY_NO_OVERWRITE = 0x1, 18 D3D11_COPY_DISCARD = 0x2 19 } 20 21 alias D3D11_LOGIC_OP = int; 22 enum : D3D11_LOGIC_OP 23 { 24 D3D11_LOGIC_OP_CLEAR = 0, 25 D3D11_LOGIC_OP_SET = ( D3D11_LOGIC_OP_CLEAR + 1 ) , 26 D3D11_LOGIC_OP_COPY = ( D3D11_LOGIC_OP_SET + 1 ) , 27 D3D11_LOGIC_OP_COPY_INVERTED = ( D3D11_LOGIC_OP_COPY + 1 ) , 28 D3D11_LOGIC_OP_NOOP = ( D3D11_LOGIC_OP_COPY_INVERTED + 1 ) , 29 D3D11_LOGIC_OP_INVERT = ( D3D11_LOGIC_OP_NOOP + 1 ) , 30 D3D11_LOGIC_OP_AND = ( D3D11_LOGIC_OP_INVERT + 1 ) , 31 D3D11_LOGIC_OP_NAND = ( D3D11_LOGIC_OP_AND + 1 ) , 32 D3D11_LOGIC_OP_OR = ( D3D11_LOGIC_OP_NAND + 1 ) , 33 D3D11_LOGIC_OP_NOR = ( D3D11_LOGIC_OP_OR + 1 ) , 34 D3D11_LOGIC_OP_XOR = ( D3D11_LOGIC_OP_NOR + 1 ) , 35 D3D11_LOGIC_OP_EQUIV = ( D3D11_LOGIC_OP_XOR + 1 ) , 36 D3D11_LOGIC_OP_AND_REVERSE = ( D3D11_LOGIC_OP_EQUIV + 1 ) , 37 D3D11_LOGIC_OP_AND_INVERTED = ( D3D11_LOGIC_OP_AND_REVERSE + 1 ) , 38 D3D11_LOGIC_OP_OR_REVERSE = ( D3D11_LOGIC_OP_AND_INVERTED + 1 ) , 39 D3D11_LOGIC_OP_OR_INVERTED = ( D3D11_LOGIC_OP_OR_REVERSE + 1 ) 40 } 41 42 struct D3D11_RENDER_TARGET_BLEND_DESC1 43 { 44 BOOL BlendEnable; 45 BOOL LogicOpEnable; 46 D3D11_BLEND SrcBlend; 47 D3D11_BLEND DestBlend; 48 D3D11_BLEND_OP BlendOp; 49 D3D11_BLEND SrcBlendAlpha; 50 D3D11_BLEND DestBlendAlpha; 51 D3D11_BLEND_OP BlendOpAlpha; 52 D3D11_LOGIC_OP LogicOp; 53 UINT8 RenderTargetWriteMask; 54 } 55 56 struct D3D11_BLEND_DESC1 57 { 58 BOOL AlphaToCoverageEnable = FALSE; 59 BOOL IndependentBlendEnable = FALSE; 60 D3D11_RENDER_TARGET_BLEND_DESC1[8] RenderTarget; 61 62 void Init() @property 63 { 64 const D3D11_RENDER_TARGET_BLEND_DESC1 defaultRenderTargetBlendDesc = 65 { 66 FALSE,FALSE, 67 D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, 68 D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, 69 D3D11_LOGIC_OP_NOOP, 70 D3D11_COLOR_WRITE_ENABLE_ALL, 71 }; 72 for (UINT i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) 73 RenderTarget[ i ] = defaultRenderTargetBlendDesc; 74 } 75 } 76 77 mixin( uuid!(ID3D11BlendState1, "cc86fabe-da55-401d-85e7-e3c9de2877e9") ); 78 extern (C++) interface ID3D11BlendState1 : ID3D11BlendState 79 { 80 void GetDesc1( 81 /*out*/ D3D11_BLEND_DESC1* pDesc); 82 } 83 84 struct D3D11_RASTERIZER_DESC1 85 { 86 D3D11_FILL_MODE FillMode = D3D11_FILL_SOLID; 87 D3D11_CULL_MODE CullMode = D3D11_CULL_BACK; 88 BOOL FrontCounterClockwise = FALSE; 89 INT DepthBias = D3D11_DEFAULT_DEPTH_BIAS; 90 FLOAT DepthBiasClamp = D3D11_DEFAULT_DEPTH_BIAS_CLAMP; 91 FLOAT SlopeScaledDepthBias = D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS; 92 BOOL DepthClipEnable = TRUE; 93 BOOL ScissorEnable = FALSE; 94 BOOL MultisampleEnable = FALSE; 95 BOOL AntialiasedLineEnable = FALSE; 96 UINT ForcedSampleCount = 0; 97 } 98 99 mixin( uuid!(ID3D11RasterizerState1, "1217d7a6-5039-418c-b042-9cbe256afd6e") ); 100 extern (C++) interface ID3D11RasterizerState1 : ID3D11RasterizerState 101 { 102 void GetDesc1( 103 /*out*/ D3D11_RASTERIZER_DESC1* pDesc); 104 } 105 106 alias D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG = int; 107 enum : D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG 108 { 109 D3D11_1_CREATE_DEVICE_CONTEXT_STATE_SINGLETHREADED = 0x1 110 } 111 112 mixin( uuid!(ID3DDeviceContextState, "5c1e0d8a-7c23-48f9-8c59-a92958ceff11") ); 113 extern (C++) interface ID3DDeviceContextState : ID3D11DeviceChild 114 { 115 } 116 117 mixin( uuid!(ID3D11DeviceContext1, "bb2c6faa-b5fb-4082-8e6b-388b8cfa90e1") ); 118 extern (C++) interface ID3D11DeviceContext1 : ID3D11DeviceContext 119 { 120 void CopySubresourceRegion1( 121 ID3D11Resource pDstResource, 122 UINT DstSubresource, 123 UINT DstX, 124 UINT DstY, 125 UINT DstZ, 126 ID3D11Resource pSrcResource, 127 UINT SrcSubresource, 128 const(D3D11_BOX)* pSrcBox, 129 UINT CopyFlags); 130 131 void UpdateSubresource1( 132 ID3D11Resource pDstResource, 133 UINT DstSubresource, 134 const(D3D11_BOX)* pDstBox, 135 const(void*) pSrcData, 136 UINT SrcRowPitch, 137 UINT SrcDepthPitch, 138 UINT CopyFlags); 139 140 void DiscardResource( 141 ID3D11Resource pResource); 142 143 void DiscardView( 144 ID3D11View pResourceView); 145 146 void VSSetConstantBuffers1( 147 UINT StartSlot, 148 UINT NumBuffers, 149 const(ID3D11Buffer)* ppConstantBuffers, 150 const(UINT)* pFirstConstant, 151 const(UINT)* pNumConstants); 152 153 void HSSetConstantBuffers1( 154 UINT StartSlot, 155 UINT NumBuffers, 156 const(ID3D11Buffer)* ppConstantBuffers, 157 const(UINT)* pFirstConstant, 158 const(UINT)* pNumConstants); 159 160 void DSSetConstantBuffers1( 161 UINT StartSlot, 162 UINT NumBuffers, 163 const(ID3D11Buffer)* ppConstantBuffers, 164 const(UINT)* pFirstConstant, 165 const(UINT)* pNumConstants); 166 167 void GSSetConstantBuffers1( 168 UINT StartSlot, 169 UINT NumBuffers, 170 const(ID3D11Buffer)* ppConstantBuffers, 171 const(UINT)* pFirstConstant, 172 const(UINT)* pNumConstants); 173 174 void PSSetConstantBuffers1( 175 UINT StartSlot, 176 UINT NumBuffers, 177 const(ID3D11Buffer)* ppConstantBuffers, 178 const(UINT)* pFirstConstant, 179 const(UINT)* pNumConstants); 180 181 void CSSetConstantBuffers1( 182 UINT StartSlot, 183 UINT NumBuffers, 184 const(ID3D11Buffer)* ppConstantBuffers, 185 const(UINT)* pFirstConstant, 186 const(UINT)* pNumConstants); 187 188 void VSGetConstantBuffers1( 189 UINT StartSlot, 190 UINT NumBuffers, 191 /*out*/ ID3D11Buffer* ppConstantBuffers, 192 /*out*/ UINT* pFirstConstant, 193 /*out*/ UINT* pNumConstants); 194 195 void HSGetConstantBuffers1( 196 UINT StartSlot, 197 UINT NumBuffers, 198 /*out*/ ID3D11Buffer* ppConstantBuffers, 199 /*out*/ UINT* pFirstConstant, 200 /*out*/ UINT* pNumConstants); 201 202 void DSGetConstantBuffers1( 203 UINT StartSlot, 204 UINT NumBuffers, 205 /*out*/ ID3D11Buffer* ppConstantBuffers, 206 /*out*/ UINT* pFirstConstant, 207 /*out*/ UINT* pNumConstants); 208 209 void GSGetConstantBuffers1( 210 UINT StartSlot, 211 UINT NumBuffers, 212 /*out*/ ID3D11Buffer* ppConstantBuffers, 213 /*out*/ UINT* pFirstConstant, 214 /*out*/ UINT* pNumConstants); 215 216 void PSGetConstantBuffers1( 217 UINT StartSlot, 218 UINT NumBuffers, 219 /*out*/ ID3D11Buffer* ppConstantBuffers, 220 /*out*/ UINT* pFirstConstant, 221 /*out*/ UINT* pNumConstants); 222 223 void CSGetConstantBuffers1( 224 UINT StartSlot, 225 UINT NumBuffers, 226 /*out*/ ID3D11Buffer* ppConstantBuffers, 227 /*out*/ UINT* pFirstConstant, 228 /*out*/ UINT* pNumConstants); 229 230 void SwapDeviceContextState( 231 ID3DDeviceContextState pState, 232 ID3DDeviceContextState* ppPreviousState) ; 233 234 void ClearView( 235 ID3D11View pView, 236 const(FLOAT)[4] Color, 237 const(D3D11_RECT)* pRect, 238 UINT NumRects); 239 240 void DiscardView1( 241 ID3D11View pResourceView, 242 const(D3D11_RECT)* pRects, 243 UINT NumRects); 244 } 245 246 mixin( uuid!(ID3D11Device1, "a04bfb29-08ef-43d6-a49c-a9bdbdcbe686") ); 247 extern (C++) interface ID3D11Device1 : ID3D11Device 248 { 249 void GetImmediateContext1( 250 /*out*/ ID3D11DeviceContext1* ppImmediateContext); 251 252 HRESULT CreateDeferredContext1( 253 UINT ContextFlags, 254 /*out*/ ID3D11DeviceContext1* ppDeferredContext); 255 256 HRESULT CreateBlendState1( 257 const(D3D11_BLEND_DESC1)* pBlendStateDesc, 258 /*out*/ ID3D11BlendState1* ppBlendState); 259 260 HRESULT CreateRasterizerState1( 261 const(D3D11_RASTERIZER_DESC1)* pRasterizerDesc, 262 /*out*/ ID3D11RasterizerState1* ppRasterizerState); 263 264 HRESULT CreateDeviceContextState( 265 UINT Flags, 266 const(D3D_FEATURE_LEVEL)* pFeatureLevels, 267 UINT FeatureLevels, 268 UINT SDKVersion, 269 REFIID EmulatedInterface, 270 /*out*/ D3D_FEATURE_LEVEL* pChosenFeatureLevel, 271 /*out*/ ID3DDeviceContextState* ppContextState); 272 273 HRESULT OpenSharedResource1( 274 HANDLE hResource, 275 REFIID returnedInterface, 276 /*out*/ void** ppResource); 277 278 HRESULT OpenSharedResourceByName( 279 LPCWSTR lpName, 280 DWORD dwDesiredAccess, 281 REFIID returnedInterface, 282 /*out*/ void** ppResource); 283 } 284 285 mixin( uuid!(ID3DUserDefinedAnnotation, "b2daad8b-03d4-4dbf-95eb-32ab4b63d0ab") ); 286 extern (C++) interface ID3DUserDefinedAnnotation : IUnknown 287 { 288 INT BeginEvent( 289 LPCWSTR Name); 290 291 INT EndEvent(); 292 293 void SetMarker( 294 LPCWSTR Name); 295 296 BOOL GetStatus(); 297 }